﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site.Master" CodeBehind="frmCidade.aspx.cs"
    Inherits="ordserv.frmCidade" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <table>
        <tr>
            <td style="width: 100px">
                Nome
            </td>
            <td style="width: 200px">
                <asp:TextBox ID="TextBox1" runat="server" Width="150px" meta:resourcekey="TextBox1Resource1"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                UF
            </td>
            <td>
                <asp:TextBox ID="TextBox2" runat="server" Width="50px" meta:resourcekey="TextBox2Resource1"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="Button1" runat="server" Text="Buscar" meta:resourcekey="Button1Resource1" />
            </td>
        </tr>
    </table>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" CellPadding="4" DataKeyNames="IdCidade" DataSourceID="odsCidade"
        ForeColor="#333333" GridLines="None" PageSize="5" meta:resourcekey="GridView1Resource1">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" meta:resourcekey="BoundFieldResource1">
                <ItemStyle Width="200px" />
            </asp:BoundField>
            <asp:BoundField DataField="UF" HeaderText="UF" SortExpression="UF" meta:resourcekey="BoundFieldResource2">
                <ItemStyle Width="50px" />
            </asp:BoundField>
            <asp:TemplateField HeaderText="Editar" meta:resourcekey="TemplateFieldResource1">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# getURL(Eval("IdCidade")) %>'
                        meta:resourcekey="HyperLink1Resource1">Editar</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Excluir" meta:resourcekey="TemplateFieldResource2">
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" AlternateText="AlternateText" CommandArgument='<%# Eval("IdCidade") %>'
                        CommandName="Delete" Height="20px" ImageUrl="~/img/delete24.bmp" ToolTip="Excluir"
                        Width="20px" meta:resourcekey="ImageButton1Resource1" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:ObjectDataSource ID="odsCidade" runat="server" SelectMethod="SelectByNomeUF"
        TypeName="ordserv.Bussiness.CidadeBS" DeleteMethod="Delete">
        <DeleteParameters>
            <asp:Parameter Name="idCidade" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="TextBox1" ConvertEmptyStringToNull="False" Name="Nome"
                PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="TextBox2" ConvertEmptyStringToNull="False" Name="UF"
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
